package com.wlcj.www.model.main;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.wlcj.plugin.xmlsql.Sql;
import com.wlcj.util.SqlUtil;

public class Penster extends Model<Penster> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final Penster dao = new Penster();
	public List<Penster> getListByRecommend(Integer start,Integer end){
		String sql ="select photo,professional_title,backgroud,name from jc_new_penster  where is_recommend = 1 order by top_level asc,update_date desc LIMIT ?,?";
		return find(sql,start,end);
	}
	public List<Penster> getListByChannelId(Integer channelId,Integer start,Integer end){
		//String sql ="select jnp.photo,jnp.professional_title,jnp.backgroud,jnp.name,jce.title,jce.title_img,jce.link,jce.description from jc_new_penster jnp,jc_content jc,jc_content_ext jce where jc.penster_id = jnp.penster_id and jc.channel_id = ? and jc.content_id = jce.content_id and jnp.is_recommend = 1 order by jc.top_level desc,jc.sort_date desc LIMIT ?,?";
		return find(SqlUtil.sql("content.getPensterList"),channelId,channelId,start,end);
	}
	public Penster getPensterById(Integer pensterId){
		return findById(pensterId);
	}
}
